vcovBK(model11)
#eststo: xtpcse totton_pc_ln pec_pc_ln gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model12 <- plm(totton_pc_ln ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model12)
#eststo: xtpcse totton_pc_ln pec_pc_ln  threat polity2 land sea, correlation(ar1) pairwise
model13 <- plm(totton_pc_ln ~ pec_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model13)
#*esttab using "navies_output10-3-2017.tex", replace cells(b(star fmt(4)) se(par fmt(3))) title(TOTTONpc Tests\label{tab1})
stargazer(model10, model11, model12, model13)
#####TABLE 5--SEE BELOW****
#####TABLE 6--Year FE********
#logit  territory_binary pec_pc_ln gdp_pc_ln threat polity2 territory_binary_years territory_binary_years_squared territory_binary_years_cubed i.year
model14 <- plm(territory_binary ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
index = year,
data=pdat,
family=binomial,
model="within")
summary(model14)
#eststo: xtreg distance_avg_ln pec_pc_ln  gdp_pc_ln threat  polity2 i.year
model15 <- plm(distance_avg_ln ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2,
index = year,
data = pdat,
model = "pooling",
pairwise = FALSE)
#eststo: xtreg totton_pc_ln pec_pc_ln gdp_pc_ln threat polity2 i.year
model16 <- plm(distance_avg_ln ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2,
index = year,
data = pdat,
model = "pooling",
pairwise = FALSE)
#*esttab using "year_fe_10-2-2017.tex", replace cells(b(star fmt(4)) se(par fmt(3))) title(TOTTONpc Tests\label{tab1})
stargazer(model14, model15, model16)
#####TABLE 7--SEE BELOW*****
#####Table 8--MID Distance tests only on sample of state years with at least one MID****
pdat$distance_avg_ln_alt <- pdat$distance_avg_ln
table(is.na(pdat$distance_avg_ln)) #8640
table(pdat$distance_avg_ln[pdat$distance_avg_ln == 0]) #25942
pdat$distance_avg_ln_alt <- ifelse(pdat$distance_avg_ln==0,NA,pdat$distance_avg_ln_alt)
table(is.na(pdat$distance_avg_ln_alt)) #34582 = 8640 + 25942
#eststo: xtp
#eststo: xtpcse distance_avg_ln_alt pec_pc_ln upop tpop milper milex gdp_pc_ln threat, correlation(ar1) pairwise
library(tidyverse)
t1 <- index(pdat)
View(t1)
t1 <- index(pdat) %>%
left_join(pdat)
t1 <- index(pdat) %>%
left_join(pdat) %>%
dplyr::select(ccode,
year,
distance_avg_ln_alt,
pec_pc_ln,
upop,
tpop,
milper,
milex,
gdp_pc_ln,
threat) %>%
mutate(ccode = index(.)[1])
View(t1)
t1 <- index(pdat)
t1 <- index(pdat) %>%
as.data.frame()
test <- rbind(t1, pdat)
t1 <- index(pdat) %>%
as.data.frame()
test <- rbind(t1, pdat)
test <- as.data.frame(pdat)
View(test)
test <- as.data.frame(pdat) %>%
dplyr::select(ccode,
year,
distance_avg_ln_alt,
pec_pc_ln,
upop,
tpop,
milper,
milex,
gdp_pc_ln,
threat) %>%
mutate(ccode = index(.)[1])
test <- as.data.frame(pdat) %>%
dplyr::select(ccode,
year,
distance_avg_ln_alt,
pec_pc_ln,
upop,
tpop,
milper,
milex,
gdp_pc_ln,
threat) %>%
na.omit()
table(test$ccode)
test <- as.data.frame(pdat) %>%
dplyr::select(ccode,
year,
distance_avg_ln_alt,
pec_pc_ln,
upop,
tpop,
milper,
milex,
gdp_pc_ln,
threat) %>%
na.omit() %>%
drop.levels()
test <- as.data.frame(pdat) %>%
dplyr::select(ccode,
year,
distance_avg_ln_alt,
pec_pc_ln,
upop,
tpop,
milper,
milex,
gdp_pc_ln,
threat) %>%
na.omit() %>%
droplevels()
model17 <- plm(distance_avg_ln_alt ~ pec_pc_ln +
upop +
tpop +
milper +
milex +
gdp_pc_ln +
threat,
data = pdat,
model = "pooling",
pairwise = TRUE)
summary(model17)
vcovBK(model17)
test <- pdat %>%
dplyr::select(ccode,
year,
distance_avg_ln_alt,
pec_pc_ln,
upop,
tpop,
milper,
milex,
gdp_pc_ln,
threat) %>%
na.omit() %>%
droplevels()
test2 <- pdat %>%
droplevels()
table(test2$ccode)
table(test$ccode)
model20 <- plm(distance_avg_ln_alt ~ pec_pc_ln +
upop +
tpop +
milper +
milex +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model20)
#eststo: logit  tcidenchal pec_pc_ln  gdp_pc_ln threat tcidenchalyrs tcidenchalyrs_squared tcidenchalyrs_cubed, cluster(ccode)
model21 <- plm(tcidenchal ~ pec_pc_ln +
gdp_pc_ln +
threat +
tcidenchalyrs +
tcidenchalyrs_squared +
tcidenchalyrs_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model21)
#eststo: logit  tcidenchal pec_pc_ln  gdp_pc_ln threat polity2 tcidenchalyrs tcidenchalyrs_squared tcidenchalyrs_cubed, cluster(ccode)
model22 <- plm(tcidenchal ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
tcidenchalyrs +
tcidenchalyrs_squared +
tcidenchalyrs_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model22)
#eststo: logit  tcidenchal  pec_pc_ln gdp_pc_ln threat polity2 land sea  tcidenchalyrs tcidenchalyrs_squared tcidenchalyrs_cubed, cluster(ccode)
model23 <- plm(tcidenchal ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
land +
sea +
tcidenchalyrs +
tcidenchalyrs_squared +
tcidenchalyrs_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model23)
#eststo: logit  territory_binary pec_pc_ln rent_addiction_high gdp_pc_ln threat polity2 land sea territory_binary_years territory_binary_years_squared territory_binary_years_cubed, cluster(ccode)
model24 <- plm(territory_binary ~ pec_pc_ln +
rent_addiction_high +
gdp_pc_ln +
threat +
polity2 +
land +
sea +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model24)
#eststo: logit  territory_binary pec_pc_ln ag_high_dummy2 gdp_pc_ln threat polity2 land sea territory_binary_years territory_binary_years_squared territory_binary_years_cubed, cluster(ccode)
model25 <- plm(territory_binary ~ pec_pc_ln +
ag_high_dummy2 +
gdp_pc_ln +
threat +
polity2 +
land +
sea +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model25)
#eststo: logit  territory_binary pec_pc_ln rent_addiction_high ag_high_dummy2 gdp_pc_ln  threat polity2 land sea territory_binary_years territory_binary_years_squared territory_binary_years_cubed, cluster(ccode)
model26 <- plm(territory_binary ~ pec_pc_ln +
rent_addiction_high +
ag_high_dummy2 +
gdp_pc_ln +
threat +
polity2 +
land +
sea +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model26)
#eststo: logit  territory_binary pec_pc_ln oil_gas_gdp gdp_pc_ln threat polity2 land sea  territory_binary_years territory_binary_years_squared territory_binary_years_cubed, cluster(ccode)
model27 <- plm(territory_binary ~ pec_pc_ln +
oil_gas_gdp +
gdp_pc_ln +
threat +
polity2 +
land +
sea +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model27)
#eststo: logit  territory_binary  pec_pc_ln ag_gdp_wdi gdp_pc_ln threat polity2 land sea  territory_binary_years territory_binary_years_squared territory_binary_years_cubed, cluster(ccode)
model28 <- plm(territory_binary ~ pec_pc_ln +
ag_gdp_wdi +
gdp_pc_ln +
threat +
polity2 +
land +
sea +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
index = c("ccode"),
data=pdat,
family=binomial,
model="within")
summary(model28)
#####TABLE 11*****
pdat$distance_max_ln <- log(pdat$distance_max+1)
pdat$distance_avg_ln <- log(pdat$distance_avg+1)
pdat$distance_avg_ln <- ifelse(pdat$year %in% seq(2002,2017),NA,pdat$distance_avg_ln)
model29 <- plm(distance_avg_ln ~ pec_pc_ln +
rent_addiction_high +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model29)
#eststo: xtpcse distance_avg_ln pec_pc_ln ag_high_dummy2 gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model30 <- plm(distance_avg_ln ~ pec_pc_ln +
ag_high_dummy2 +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model30)
#eststo: xtpcse distance_avg_ln pec_pc_ln rent_addiction_high ag_high_dummy2 gdp_pc_ln  threat polity2 land sea, correlation(ar1) pairwise
model31 <- plm(distance_avg_ln ~ pec_pc_ln +
rent_addiction_high +
ag_high_dummy2 +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model31)
#eststo: xtpcse distance_avg_ln pec_pc_ln oil_gas_gdp gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model32 <- plm(distance_avg_ln ~ pec_pc_ln +
oil_gas_gdp +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model32)
#eststo: xtpcse distance_avg_ln pec_pc_ln ag_gdp_wdi gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model33 <- plm(distance_avg_ln ~ pec_pc_ln +
ag_gdp_wdi +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model33)
#eststo: xtpcse totton_pc_ln pec_pc_ln rent_addiction_high gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model34 <- plm(totton_pc_ln ~ pec_pc_ln +
rent_addiction_high +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model34)
#eststo: xtpcse totton_pc_ln pec_pc_ln ag_high_dummy2 gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model35 <- plm(totton_pc_ln ~ pec_pc_ln +
ag_high_dummy2 +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model35)
#eststo: xtpcse totton_pc_ln pec_pc_ln rent_addiction_high ag_high_dummy2 gdp_pc_ln  threat polity2 land sea, correlation(ar1) pairwise
model36 <- plm(totton_pc_ln ~ pec_pc_ln +
rent_addiction_high +
ag_high_dummy2 +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model36)
#eststo: xtpcse totton_pc_ln pec_pc_ln oil_gas_gdp gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model37 <- plm(totton_pc_ln ~ pec_pc_ln +
oil_gas_gdp +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model37)
#eststo: xtpcse totton_pc_ln pec_pc_ln  ag_gdp_wdi gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model38 <- plm(totton_pc_ln ~ pec_pc_ln +
ag_gdp_wdi +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = pdat,
model = "pooling",
pairwise = TRUE)
vcovBK(model38)
#drop if year < 1946
#dat_postww2 <- subset(dat, year < 1946)
# ISSUE: this drops everything after 1946
# also, this operation should happen on the pdata.frame, so plm() can handle the data input
dat_postww2 <- pdat[pdat$year %in% seq(1946, 2017),]
#eststo: logit  territory_binary pec_pc_ln gdp_pc_ln threat polity2 territory_binary_years territory_binary_years_squared territory_binary_years_cubed
model39 <- plm(territory_binary ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
data=pdat,
family=binomial,
model="within")
summary(model39)
#eststo: xtpcse distance_avg_ln pec_pc_ln  gdp_pc_ln threat polity2,correlation(ar1) pairwise
model39 <- plm(distance_avg_ln ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2,
data = dat_postww2,
model = "pooling",
pairwise = TRUE)
vcovBK(model39)
#eststo: xtpcse totton_pc_ln pec_pc_ln gdp_pc_ln threat polity2, correlation(ar1) pairwise
model40 <- plm(totton_pc_ln ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2,
data = dat_postww2,
model = "pooling",
pairwise = TRUE)
vcovBK(model40)
# dat_nomajpower <- subset(dat,
#                         ccode!=2 & ccode!=200 &
#                         ccode!=220 & ccode!=255 &
#                         ccode!=300 & ccode!=325 &
#                         ccode!=365 & ccode!=710 &
#                         ccode!=740)
dat_nomajpower <- pdat[!(pdat$ccode %in% c(2, 200, 220, 255, 300, 325, 365, 710, 740)),]
#eststo: logit  territory_binary pec_pc_ln gdp_pc_ln threat polity2 land sea territory_binary_years territory_binary_years_squared territory_binary_years_cubed
model41 <- plm(territory_binary ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
territory_binary_years +
territory_binary_years_squared +
territory_binary_years_cubed,
data=pdat,
family=binomial,
model="within")
summary(model41)
#eststo: xtpcse distance_avg_ln pec_pc_ln  gdp_pc_ln threat polity2 land sea,correlation(ar1) pairwise
model42 <- plm(distance_avg_ln ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = dat_nomajpower,
model = "pooling",
pairwise = TRUE)
vcovBK(model42)
#eststo: xtpcse totton_pc_ln pec_pc_ln gdp_pc_ln threat polity2 land sea, correlation(ar1) pairwise
model43 <- plm(totton_pc_ln ~ pec_pc_ln +
gdp_pc_ln +
threat +
polity2 +
land +
sea,
data = dat_nomajpower,
model = "pooling",
pairwise = TRUE)
vcovBK(model43)
